package com.zz.framework.core.http


/**
 * Copyright © 2024 zhun All rights reserved.
 * Created by Zha0Zhun on 2024/6/30 23:15.
 * @author: Zha0Zhun 1820022519@qq.com
 * @version: V1.0
 */
data class HttpResponse<T>(
    val data: T? = null,
    val token: T? = null,
    val code: Int = 1, //手机端返回 200 成功
    val msg: String?,
    val success: Boolean =false
):IResponse<T>{
    override fun isSuccess(): Boolean {
        return code()==200
    }

    override fun message(): String? {
        return msg?:"请求失败请稍后重试"
    }

    override fun data(): T? {
        return data?:token
    }

    override fun code(): Int {
        return code
    }
}